package com.klangner.math.worksheet;

import com.klangner.math.worksheet.SimplifyExpression;

import junit.framework.TestCase;

public class AlgebraTestCase extends TestCase {

	/** 
	 * Test data. Format:
	 * input => expected output 
	 */
	private static final String[][] testData = {
		{"2+3","5"},
		{"2*3","6"},
		{"2*3-12","-6"},
		{"3*x + 2*x","5*x"},
		{"3*x^2+2*x^2","5*x^2"}
	};
	
	
	public void testData() {
		SimplifyExpression se = new SimplifyExpression();
		String output;
		
		for(int i = 0; i < testData.length; i++){
		
			output = se.simplify(testData[i][0]);
			assertEquals("Input: " + testData[i][0], testData[i][1], output);
		}
	}

}
